﻿<%@ Page Title="这是测试" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="AjaxHello.aspx.cs" Inherits="FrontTest.About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
    <script type="text/javascript">

        var xmlHttpReq = null;

        function Ajax() {
            if (window.ActiveXObject) {
                xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
            } else {
                xmlHttpReq = new XMLHttpRequest();
            }
            xmlHttpReq.open("GET", "test.aspx", true);
            xmlHttpReq.onreadystatechange = RequestCallBack;
            xmlHttpReq.send(null);
        }

        function RequestCallBack() {
            if (xmlHttpReq.readyState == 4) {
                if (xmlHttpReq.status == 200) {
                    document.getElementById("resText").innerHTML += xmlHttpReq.responseText;
                }
            }
        }

        $(function () {
            $("#loadBtn").click(function () {
                $("#loadDiv").load("test.aspx");
            });
        });

    </script>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <input type="button" value="Ajax提交" onclick="Ajax();" />
    <div id="resText">
    </div>
    <input type="button" value="LoadData" id="loadBtn" />
    <div id="loadDiv"></div>
</asp:Content>
